﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class top_1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!Page.IsPostBack)
        {
            if (Session["sUserName"] == null && Session["sRole"]==null)
            {
                Response.Write("<script language=javascript>alert('未登录或登录已到期，请返回登录页面重新登录！');if(opener!=null){opener.location.reload();window.close();}</script>");
                Response.Write("<script language=javascript> window.open('logout.aspx',target='_top')</script>");
                return;
            }
            
        }
        lblWelcome.Text = "欢迎您 " + Session["sRole"].ToString().Trim() + Session["sUserName1"].ToString().Trim() + "  " + DateTime.Now.ToLongDateString() + "  "+DateTime.Now.DayOfWeek.ToString();
    }

}
